home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / scanVideo.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.6 KB  |  80 lines  |  [TEXT/MPS ]

  1. (*
  2.     scanVideo fb - Scan forward (if fb is "forward") or backward (if fb is "backward").
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w scanVideo.p
  7.  
  8.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=8003 -sn Main=scanVideo ∂
  9.             scanVideo.p.o "{MPW}"Libraries:interface.o "{MPW}"PLibraries:PasLib.o
  10.  
  11.     Copyright © 1987,88 Apple Computer, Inc.
  12.  
  13.     9/87 - Initial coding by Harry R. Chesley.
  14.     2/88 - Changed to new interface specification by Harry R. Chesley.
  15. *)
  16.  
  17. {$R-}
  18.  
  19. {$S scanVideo }     { Segment name must be the same as the command name. }
  20.  
  21. unit DummyUnit;
  22.  
  23. interface
  24.  
  25. uses MemTypes, QuickDraw, OSIntf, HyperXCmd;
  26.  
  27. procedure EntryPoint(paramPtr: XCmdPtr);
  28.     
  29. implementation
  30.  
  31. type
  32.  
  33. Str31 = String[31];
  34.  
  35. procedure scanVideo(paramPtr: XCmdPtr); forward;
  36.  
  37. procedure EntryPoint(paramPtr: XCmdPtr);
  38.  
  39.     begin
  40.         scanVideo(paramPtr);
  41.     end;
  42.  
  43. procedure scanVideo(paramPtr: XCmdPtr);
  44.  
  45.     var str: str255;
  46.         firstChar: char;
  47.  
  48.     {$I XCmdGlue.inc}
  49.  
  50.     procedure Fail(errMsg: Str255); { set theResult and quit }
  51.         begin
  52.             paramPtr^.returnValue := PasToZero(errMsg);
  53.             exit(scanVideo);
  54.         end;
  55.  
  56.     {$I VideoUtil.inc}
  57.  
  58.     begin
  59.         if paramPtr^.paramCount > 1 then Fail('parameter count is 0 or 1');
  60.  
  61.         { Get the direction. }
  62.         str := 'forward';
  63.         if paramPtr^.paramCount > 0 then
  64.             begin
  65.                 GetStrParm(1,str);
  66.                 { Make sure things are in "standard" format. }
  67.                 if length(str) >= 1 then
  68.                     begin
  69.                         case str[1] of
  70.                             'b', 'B', 'r', 'R': str := 'backward';
  71.                             end;
  72.                     end;
  73.             end;
  74.  
  75.         { Do it. }
  76.         paramPtr^.returnValue := PasToZero(videoFunc('scan',str));
  77.     end;
  78.  
  79. end.
  80.